
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.LockSupport;

/**
 * @ClassName A12
 * @Description
 * @Author Jingxiao.Ye
 * @Date 2021/11/28 下午11:59
 * @Version V1.0
 * @Since JDK 11
 */
public class A12 {

    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger();
        Thread thread1 = Thread.currentThread();
        Thread thread = new Thread(() -> {
            try {
                Integer call = new Task().call();
                atomicInteger.set(call);
                LockSupport.unpark(thread1);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
        thread.start();
        LockSupport.park();
        System.out.println(atomicInteger.get());
    }

}
